<%@ page contentType="text/html; charset=UTF-8"%>
<%@ include file="/classes/CommonHelper.class.jsp"%>
<%@ include file="/classes/DBHelper.class.jsp"%>
<%@ include file="/common/basePath.jsp"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%

	request.setCharacterEncoding("UTF-8");
	String keyword = getParameterAndSetAttribute(request,"keyword");
	String sql = "select t.guid,t.bjb_name,t.jb_wtlx,t.jb_zywt,t.create_time from APP_JBZX_INFO t where 1=1 " ;
	List<Object> params = new ArrayList<Object>();
	if(!nullOrEmpty(keyword)){
		sql +=" and (t.jb_zywt like ?";
		params.add("%"+keyword+"%");
		sql +=" or t.bjb_name like ?";
		params.add("%"+keyword+"%");
		sql +=" or t.jb_wtlx like ?)";
		params.add("%"+keyword+"%");
	}
	
	sql += " order by t.create_time desc";
	
	int currentPage = 1; 
	if(!nullOrEmpty(getParameter(request,"currentPage"))){
		currentPage = Integer.parseInt(getParameter(request,"currentPage"));
	}

	List<Map<String,Object>> list = queryForListPage(sql,params,currentPage,15);
	
	int total = queryForPageCount(sql,params);
	
	Map<String,Integer> pageMap = new HashMap<String,Integer>();
	pageMap.put("currentPage",currentPage);
	pageMap.put("total",total);
	request.setAttribute("page",pageMap);


%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>信访举报</title>
<script type="text/javascript" src="../js/jquery-1.7.min.js"></script>
<link rel="stylesheet" href="../css/tablecloth.css"  />
<style type="text/css">
</style>
</head>
	<body style="padding: 0px; margin: 0px; font-size: 12px;">
	<form name="myform" action="xfjb_gl_list.jsp?r=<%=new Date().getTime()%>" method="post">
	<table>
		<tr>
			<td> 关键字：<input type="text" name="keyword" value="${keyword }"/> </td>
			<td> <input type="submit" value="查询"/> </td>
		</tr>
	</table>
	<table id="mytable" style="width: 100%">
		<tr>
			<th width="160">被举报人姓名（单位名称）</th>
			<th width="160">问题类型</th>
			<th>主要问题</th>
			<th width="120">举报时间</th>
			<th width="100">查看详细</th>
		</tr>
		<c:forEach items="<%=list %>" var="info">
		<tr>
			<td>${info.bjb_name }</td>
			<td>${info.jb_wtlx }</td>
			<td>${info.jb_zywt }</td>
			<td>
			<c:if test="${null!=info.create_time }">
				<fmt:formatDate value="${info.create_time }" pattern="yyyy-MM-dd"/>
			</c:if>	
			</td>
			<td>
			[<a href="xxjb_gl_detail.jsp?guid=${info.guid }&r=<%=new Date().getTime()%>">详情</a>]	
			</td>
		</tr>
		</c:forEach>
		<tr>
			<td colspan="5">
				<jsp:include page="/common/page.jsp" >
		    		<jsp:param value="${page.currentPage }" name="currentPage"/>
					<jsp:param value="${page.total }" name="totalRecord"/>
					<jsp:param value="15" name="pageSize"/>
					<jsp:param value="myform" name="formName"/>
					<jsp:param value="<%=new Date().getTime() %>" name="r"/>
		    	</jsp:include>
			</td>
		</tr>
	</table>
	</form>
	</body>
</html>
